#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1e6 + 5;

int n, k;
unsigned long long a[N];

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> k;
  rep(i, 1, n) cin >> a[i];
  deque<int> dq;
  rep(i, 1, n) {
    while (dq.size() && a[dq.back()] <= a[i]) dq.pop_back();
    dq.push_back(i);
    while (dq.size() && dq.front() <= i - k) dq.pop_front();
    if (i >= k) cout << dq.size() << endl;
  }
  return 0;
}